/**
 * Version 14 mrt 2008 - initial version
 */
package audioreaper.machine;

/**
 * <code>MachineContext</code>.
 *
 * @author <a href="mailto:vincent@nazarene.nl">Vincent van Beveren</a>
 *
 */
public interface MachineContext {

	int VOLUME_MIN = 0;
	int VOLUME_NORMAL = 512;
	int VOLUME_MAX = 1024;
	
	int PANNING_CENTER = 0;
	int PANNING_MAX = 1024;
	int PANNING_MIN = -1024;
	
	enum ChannelConfig {
		MONO(1),		// reserved for future use
		STEREO(2),		// only stereo is supported right now
		SURROUND(4);	// reserved for future use

		private int _nrOfChannels;
		
		private ChannelConfig(int nrOfChannels) {
			_nrOfChannels = nrOfChannels;
		}		

		public int getNrOfChannels() {
			return _nrOfChannels;
		}
	}
	
	Machine getNode(String name);
	
	Master getMaster();
	
	/** only 16 bps is supported right now. */
	int getBitsPerSample();
	
	/** only 44.1kHz is supported right now. */
	int getSampleRate();
	
	ChannelConfig getChannelConfig();
	
	/**
	 * Buffer size, is samples per block * channel config
	 */
	int getBufferSize();
	
	int[] createBuffer();
	
}
